<?php require_once ADMINVIEWPATH.'admin_header.php'; ?>
<?php require_once ADMINVIEWPATH.'admin_menu.php'; ?>
<!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <i class="fa fa-home"></i>
                            <a href="#">首页</a>
                        </li>
                        <li>
                            <a href="#">招聘管理</a>
                        </li>
                        <li class="active"> 招聘职位列表 </li>
                    </ul>
                </div>
                <!-- /Page Breadcrumb -->
                <!-- Page Header -->
                <div class="page-header position-relative">
                    <!--Header Buttons-->
                    <div class="header-buttons">
                        <a class="sidebar-toggler" href="#">
                            <i class="fa fa-arrows-h"></i>
                        </a>
                        <a class="refresh" id="refresh-toggler" href="">
                            <i class="glyphicon glyphicon-refresh"></i>
                        </a>
                        <a class="fullscreen" id="fullscreen-toggler" href="#">
                            <i class="glyphicon glyphicon-fullscreen"></i>
                        </a>
                    </div>
                    <!--Header Buttons End-->
                </div>
                <!-- /Page Header -->
                <!-- Page Body -->
                <div class="page-body">
                    <div class="row">
                        <div class="col-xs-12 col-md-12">
                            <div class="tab-content tabs-flat no-padding">
                                <div id="visits" class="tab-pane active animated fadeInUp">
                                    <div class="row">
                                        <div class="col-lg-12 chart-container">
                                            <div id="dashboard-chart-visits" class="chart chart-lg no-margin">
                                                <div class="widget-body">
                                                     <div class="table-toolbar">
                                                            <a href="/luckydog/job/textures" id="editabledatatable_new"   class=" btn btn-default">
                                                            添加招聘职位
                                                            </a>
                                                        </div>
                                                        <table class="table table-striped table-bordered table-hover" id="simpledatatable">
                                                            <thead>
                                                                <tr>
                                                                    <th>ID</th>
                                                                    <th>招聘职位</th>
                                                                    <th>招聘人数</th>
                                                                    <th>职位简介</th>
                                                                    <th>排序</th>
                                                                    <th>添加时间</th>
                                                                    <th>操作</th>
                                                                </tr>
                                                            </thead>
                                                            <tbody>
                                                            <tr>
                                                                <?php if(!empty($jobList)):?>
                                                                    <?php foreach($jobList as $key=> $row):?>
                                                                        <tr class="gradeX ">
                                                                            <td class="center"><?php echo $row['id']?></td>
                                                                            <td class="center"><?php echo $row['job_name']?></td>
                                                                            <td class="center"><?=$row['num']?></td>
                                                                            <td class="center reivew_video" data-content = "<?php echo  cutstr(strip_tags($row['job_intro']),30,"……")?>"><div><?php echo  cutstr(strip_tags($row['job_intro']),30,"……")?></div></td>
                                                                            <td class="center"><?=$row['sort_order']?></td>
                                                                            <td class="center"><?php echo  date("Y-m-d h:i",$row['add_time'])?></td>
                                                                            <td class="center " data_id = "<?php echo $row['id'];?>">
                                                                                <a href="/luckydog/job/textures?id=<?php echo $row['id'];?>" >编辑</a>&nbsp;|&nbsp;<a href="javascript:;" class="J_del">删除</a>
                                                                            </td>
                                                                        </tr>
                                                                    <?php endforeach;?>
                                                                <?php endif;?>
                                                            </tr>
                                                            </tbody>
                                                        </table>
                                                    </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Page Body -->
        </div>

       
        <!-- /Page Content -->
<script src="<?php echo STATICURL; ?>js/jquery-2.0.3.min.js"></script>
<script src="<?php echo STATICURL; ?>layer/layer.js"></script>
<?php require_once ADMINVIEWPATH.'admin_footer.php'; ?>
<script src="<?=STATICURL; ?>layer/layer.js"></script>
<script>
    $('.tab_active').on('click',function(){
        var type = $(this).attr('data-type');
        location = '/luckydog/news/index?type='+type;
    })

    <?php if($type == 2):?>
    $(".reivew_video").click(function(){
        var redirecturl = $(this).attr('data-content');
        layer.open({
              type: 2,
              title: false,
              area: ['630px', '360px'],
              shade: 0.8,
              closeBtn: 0,
              shadeClose: true,
              content: redirecturl
            });
    });
    <?php endif;?>


    $(document).ready(function() {
        $(".J_del").click(function() {
            var id = $(this).parent().attr("data_id");
            if (confirm("您确定要删除吗？")) {
                $.post("/luckydog/job/delJob?debug=1", {"id":id}, function(res) {
                    if (res) {
                        window.location.reload();
                    }else{
                        alert("删除失败");
                    }
                });
            }
        });

        $(".J_Setstatus").click(function() {
            var id = $(this).parent().attr("data_id");
            var status = $(this).attr("status");
            if(status == 1){
                status = -1;
            }else{
                status = 1;
            }
            $.post("/luckydog/account/setStatus", {"id":id,"status":status}, function(res) {
                if (res) {
                    window.location.reload();
                }else{
                    alert("失败");
                }
            });
        });
    });

</script>


